<link rel="stylesheet" href="assets/css/mycss.css">
<div class="main-container" id="main-container"
	xmlns:th="http://www.thymeleaf.org">
	<div class="main-container-inner">
		<div class="main-content">
			<div class="page-content">
				<div class="row">
					<form class="form-horizontal" role="form" id="auth_mod_form">
						<input type="hidden" name="id" th:value="${id}">
						<div class="form-group">
							<label for="dvalue" class="col-sm-3 control-label">用户名</label>
							<div class="col-sm-7">
								<label class="control-label" id="usernameLabel"></label>
							</div>
						</div>
						<div class="form-group">
							<label for="dvalue" class="col-sm-3 control-label">密码</label>
							<div class="col-sm-7">
								<input class="form-control" name="userpwd">
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript" src="assets/js/validate/jquery.validate.min.js"></script>
<script type="text/javascript" src="assets/js/validate/additional-methods.min.js"></script>
<script type="text/javascript" src="assets/js/validate/localization/messages_zh.min.js"></script>
<script type="text/javascript" src="assets/js/comm.js"></script>
<script type="text/javascript">
    function form_sub() {
    	if(!$("#auth_mod_form").valid()) {
    		return;
    	}
        var json = $("#auth_mod_form").serializeJson();
        ajaxs("/server/modAuth", "PUT", json, true, function(data) {
    		if(data.state == 'success') {
    			$.CloseFormDialog();
    			// 刷新表格
    			layer.msg("修改成功");
    		} else {
    			layer.msg(data.message);
    		}
        });
    }
    
    $("#auth_mod_form").validate({
   		rules: {
	   	    username: {
	   	      maxlength: 20,
	   	   	  pattern: '[0-9a-zA-Z_]{1,}$'
	   	    }
   	    }
   	});
</script>